package com.geetour.columbus.region.dao.impl;

import com.geetour.columbus.common.exceptions.DAOException;
import com.geetour.columbus.common.model.R.SpotPage;
import com.geetour.columbus.core.ibatis.SqlMapClientDaoSupportEx;
import com.geetour.columbus.region.dao.ISpotPageDAO;

public class SpotPageDAOImpl extends SqlMapClientDaoSupportEx implements ISpotPageDAO {

    @Override
    public int insertSpotPage(SpotPage spot) throws DAOException {
        if (spot == null) {
            return -1;
        }
        this.insert("insertSpotPage", spot);
        return 1;
    }

    @Override
    public int updateSpotPage(SpotPage spot) throws DAOException {
        if (spot == null) {
            return -1;
        }
        return this.update("updateSpotPage", spot);
    }

    @Override
    public int deleteSpotPageById(Long id) throws DAOException {
        if (id == null) {
            return -1;
        }
        return this.delete("deleteSpotPageById", id);
    }

    @Override
    public SpotPage findSpotPageById(Long id) throws DAOException {
        if (id == null) {
            return null;
        }
        return (SpotPage) this.queryObject("findSpotPageById", id);
    }

}
